package com.demo.appcli;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserControl {
	
	@RequestMapping("/tab")
	public String UserInfo(Model model) {
		List<UserInfo> list = new ArrayList<UserInfo>();
		
		UserInfo user = new UserInfo();
		user.setUsername("CAI");
		user.setSex("BOY");
		user.setAge("20");
		
		UserInfo user1 = new UserInfo();
		user1.setUsername("CAI");
		user1.setSex("BOY");
		user1.setAge("20");
		
		UserInfo user2 = new UserInfo();
		user2.setUsername("CAI");
		user2.setSex("BOY");
		user2.setAge("20");
		
		UserInfo user3 = new UserInfo();
		user3.setUsername("CAI");
		user3.setSex("BOY");
		user3.setAge("20"); 
		
		list.add(user);
		list.add(user1);
		list.add(user2);
		list.add(user3);
		
		model.addAttribute("users", list);
		return "user/user";
		
	}

	

}
